<% modelname = EducationalPlan.human_name %>
<% form_for(@educational_plan) do |f| %>
  <%= f.error_messages %>

  <table class="form_table" cellpadding="0" cellspacing="0" style="border-top: 0px;">

    <caption style="border-bottom: 0px;">
      <%= "#{controller.action_name == 'edit' ? t(:update_x, :x => modelname) : t(:create_x, :x => modelname)}" %>
    </caption>

    <tr>
      <td class="label"><%= f.label EducationalPlan.human_attribute_name(:name) %></td>
      <td><%= f.text_field :name %></td>

      <td class="label"><%= f.label EducationalPlan.human_attribute_name(:abbreviation) %></td>
      <td><%= f.text_field :abbreviation %></td>
    </tr>

    <tr>
      <td class="label"><%= f.label EducationalPlan.human_attribute_name(:academic_degree) %></td>
      <td>
        <%=f.select(:academic_degree_id , AcademicDegree.all.collect {|p| [ p.name, p.id ] }, { :include_blank => false }) %>
      </td>

      <td class="label"><%= f.label EducationalPlan.human_attribute_name(:educational_level) %></td>
      <td>
        <%=f.select(:educational_level_id , EducationalLevel.all.collect {|p| [ p.name, p.id ] }, { :include_blank => false }) %>
      </td>
    </tr>

    <tr>
      <td class="label"><%= f.label EducationalPlan.human_attribute_name(:passing_grade) %></td>
      <td><%=f.select(:passing_grade_id , Grade.all(:conditions => :is_passing_grade).collect {|p| [ "#{p.name} (#{p.abbreviation})", p.id ] }, { :include_blank => false }) %>
      </td>

      <td class="label"><%= f.label EducationalPlan.human_attribute_name(:term) %></td>
      <td>
        <%=f.select(:term_id , Term.all.collect {|p| [ p.name, p.id ] }, { :include_blank => false }) %>
      </td>
    </tr>

    <tr>
      <td class="label"><%= f.label EducationalPlan.human_attribute_name(:total_credits) %></td>
      <td><%= f.text_field :total_credits, :style => "width: 65px;" %></td>
      
      <td class="label"><%= f.label EducationalPlan.human_attribute_name(:duration_in_terms) %></td>
      <td><%= f.text_field :duration_in_terms, :style => "width: 65px;" %></td>
    </tr>

    <tr>
      <td class="label"><%= f.label EducationalPlan.human_attribute_name(:min_duration) %></td>
      <td><%= f.text_field :min_duration, :style => "width: 65px;" %></td>

      <td class="label"><%= f.label EducationalPlan.human_attribute_name(:max_duration) %></td>
      <td><%= f.text_field :max_duration, :style => "width: 65px;" %></td>
    </tr>

    <tr>
      <td class="label"><%= f.label EducationalPlan.human_attribute_name(:active) %></td>
      <td><%= f.check_box :active %></td>

      <td class="label"><%= f.label EducationalPlan.human_attribute_name(:year) %></td>
      <td><%= f.text_field :year, :style => "width: 65px;" %></td>
    </tr>

    <tr>
      <td class="submit" colspan="4">
        <%= f.submit controller.action_name == 'edit' ? t(:update) : t(:create) %>
      </td>
    </tr>
  </table>

<% end %>

